package com.xiaoxu.springboot.modules.test.dao;

import com.xiaoxu.springboot.modules.test.entity.Student;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StudentDao extends JpaRepository<Student,Integer> {
    List<Student> findByStudentName(String studentName);

    @Query(value = "from Student where id = :id")
    Student getStudentById(@Param("id") int id);

}
